/*
 * UtilSDL.cpp
 *
 *  Created on: 29/08/2008
 *      Author: samuel.grigolato
 */

#include "UtilSDL.h"

UtilSDL::UtilSDL() {
	//
}

void UtilSDL::ConfiguraTitulo(char* Titulo, char* Icone) {
	SDL_WM_SetCaption(Titulo, NULL);
	SDL_WM_SetIcon(IMG_Load(Icone), NULL);
}

SDL_Surface* UtilSDL::ConfiguraJanela(int Largura, int Altura, int BPP, Uint32 Flags) {
	SDL_Surface* SurfDisplay = NULL;
	if((SurfDisplay = SDL_SetVideoMode(Largura, Altura, BPP, Flags)) == NULL) {
		fprintf(stderr, "Erro ao carregar background: %s", SDL_GetError());
		exit(1);
	}
	return SurfDisplay;
}

bool UtilSDL::ConfiguraSDL(Uint32 Flags) {
	return SDL_Init(Flags) < 0;
}

UtilSDL::~UtilSDL() {
	//
}
